package com.my.task;

import cn.hutool.core.date.DateUtil;

import java.util.TimerTask;

/**
 * @author: marshal
 * @date: 2022-10-17 15:17
 */
public class MyTask extends TimerTask {

    private final String taskName;

    public MyTask(String taskName) {
        this.taskName = taskName;
    }

    @Override
    public void run() {
        System.out.println("time : " + DateUtil.now() + ", " + taskName + " execute.");
    }
}
